package pro.team.utils;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.InputStream;

/**
 * @author: mujin
 * @createTime: 2020/11/4 20:20
 */
public class MysqlConnectUtils {

    public static SqlSessionFactory getSqlSessionFactory(){
        InputStream resourceAsStream = Class.class.getResourceAsStream("/mybatis.xml");
        System.out.println(resourceAsStream);
        SqlSessionFactory sqlSessionFactory=new SqlSessionFactoryBuilder().build(resourceAsStream);
        return sqlSessionFactory;

    }

}
